/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * PPantallaPrincipal.java
 *
 * Created on 05-oct-2011, 10:24:30
 */
package MainWindows;

import java.awt.*;
import java.awt.image.BufferedImage;
import java.io.*;
import javax.imageio.ImageIO;

/**
 *
 * @author Michael
 */
public class PImgLogo extends javax.swing.JPanel {

    BufferedImage offScreen = null;
    BufferedImage backGround = null;
    public PImgLogo(FPantallaPrincipal padre) {
        initComponents();
        this.setBounds(padre.getWidth()/2-75,3 , 150, 150);
        try {
            backGround = ImageIO.read(getClass().getResource("/resources/logo2.png"));
        } 
	catch (IOException e) {
            e.printStackTrace();
        }
        
    }
    public void paintComponent(Graphics g) {
        Dimension tamanio = getSize();
        offScreen = (BufferedImage) createImage(tamanio.width,tamanio.height);        
        offScreen.getGraphics().drawImage(backGround, 0, 0, tamanio.width, tamanio.height,new Color(255, 213, 27), this);

        g.drawImage(offScreen,0,0,this);
        setOpaque(false);
        //super.paintComponent(g);
    }
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 159, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 141, Short.MAX_VALUE)
        );
    }// </editor-fold>//GEN-END:initComponents
    // Variables declaration - do not modify//GEN-BEGIN:variables
    // End of variables declaration//GEN-END:variables
}
